@extends('admin_system/public/layout')
@section('content')
    <div class="col-xs-12 top-nav nav">
        <p class="float-left"><strong>当前位置：</strong>app版本管理>>新增版本</p>

        {{--返回按钮--}}
        <button type="button" class="btn btn-default float-right back" aria-label="Left Align">
            <span class="glyphicon glyphicon-arrow-left back" aria-hidden="true"></span>
            <span>返回</span>
        </button>
    </div>


    <div class="col-xs-12"></div>

    <div class="content-box col-xs-12 mt20 pb20 pt20">
        <form class="col-xs-4" id="form" action="{{asset('/admin_system/appversion/editAction')}}" method="post" enctype="multipart/form-data">

            <input type="hidden" name="id" value="{{$app->id}}">
            {{ csrf_field() }}

            <div class="form-group">
                <label>客户端</label>
                <select name="client" class="form-control">
                    @if($app->client == 'IOS')
                        <option value="Android">Android</option>
                        <option value="IOS" selected>IOS</option>
                    @else
                        <option value="Android" selected>Android</option>
                        <option value="IOS">IOS</option>
                    @endif
                </select>
            </div>
            
            <div class="form-group">
                <label>版本名称</label>
                <input name="version_name" class="form-control" value="{{$app->version_name}}" required placeholder="1.1.5">
            </div>

            <div class="form-group">
                <label>版本号</label>
                <input class="form-control" name="version_code" value="{{$app->version_code}}" required placeholder="20170520">
            </div>

            <div class="form-group">
                <label>更新信息</label>
                <textarea class="form-control" name="content" style="min-height:100px;">{{$app->content}}</textarea>
                <em style="color:red;">每条信息以分号(;)隔开</em>
            </div>

            <div class="form-group">
                <label>APK文件</label>
                <input name="apk" type="file" class="form-control">
            </div>

            <div class="form-group">
                <label for="">是否上架</label>
                <select name="is_show" class="form-control">
                    @if($app->is_show == 0)
                        <option value="1">上架</option>
                        <option value="0" selected>下架</option>
                    @else
                        <option value="1" selected>上架</option>
                        <option value="0">下架</option>
                    @endif
                </select>
            </div>
            <input type="submit" class="btn btn-danger"  onclick="$(this).prop('disabled',true);$(this).val('上传中...');$('#form').submit();" value="提交">
        </form>
    </div>

@endsection
